/************************************************************************************
* PartialCollectionModel.h                                                          *
*                                                                                   *
* Copyright (C) 2011 Varuna L Amachi                                                *
*                                                                                   *
* This program is free software; you can redistribute it and/or modify              *
* it under the terms of the GNU General Public License as published by              *
* the Free Software Foundation; either version 2 of the License, or any             *
* later version.                                                                    *
*                                                                                   *
* This program is distributed in the hope that it will be useful, but               *
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY        *
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for       *
* more details. You should have received a copy of the GNU General Public           *
* License along with this program; if not, write to the Free Software Foundation,   *
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA                       *
*                                                                                   *
*************************************************************************************/

#ifndef PARTIALCOLLECTIONMODEL_H
#define PARTIALCOLLECTIONMODEL_H

#include "collector/CollectorItem.h"

#include <QAbstractItemModel>
#include <QList>
#include <QMap>

class PartialCollectionModel : public QAbstractItemModel
{
    Q_OBJECT
protected:
    QList<CollectorItem *> *m_items;
public:
    explicit PartialCollectionModel(QObject *parent = 0);
    ~PartialCollectionModel();

    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
    QModelIndex index(int row, int column, const QModelIndex &parent) const;
    QModelIndex parent(const QModelIndex &child) const;
    bool hasChildren(const QModelIndex &parent) const;

    inline bool isEmpty() {
        return m_items == NULL?true:(m_items == 0);
    }

signals:

public slots:
    void setModel(QList<CollectorItem *>* items);
    void append(CollectorItem *item);
//    void remove(QList<QString>& ids);
    void clear();

};

#endif // PARTIALCOLLECTIONMODEL_H
